#pragma once
#define RESOURCE_TYPE_POSTEFFECT 6
class WPENGIN_API CPostProcessEffectFile:public CGraphicsFileResource
{
private:
	  ID3DXEffect*     m_pEffect;
	  D3DXHANDLE m_hTechnique;
	  D3DXTECHNIQUE_DESC m_techniqueDesc;
	  D3DXHANDLE m_hSrcTexture;
public:
	CPostProcessEffectFile(const TCHAR * resName,const TCHAR * szFilePath, 	D3DPOOL pool = D3DPOOL_DEFAULT);
	~CPostProcessEffectFile(void);
	void SetSrcTextue( LPDIRECT3DTEXTURE9 pTexture){ m_pEffect->SetTexture(m_hSrcTexture,pTexture);}
	virtual void OnD3D9DestroyDevice();
	virtual HRESULT OnD3D9ResetDevice( IDirect3DDevice9* pd3dDevice );
	virtual void OnD3D9LostDevice();
	virtual HRESULT OnD3D9CreateDevice( IDirect3DDevice9* pd3dDevice );
	ID3DXEffect * GetEffect(){return m_pEffect;}
	int totalPasses()const;
	bool begin();
	bool activatePass(int pass);
	bool CommitChanges();
	bool endPass();
	void end();
 
};

